import request from '../../../utils/request'

export default ({

  getAdminListPage(current, limit, userQuery) {
    return request({
      url: `/user/admin/pageAdminCondition/${current}/${limit}`,
      method: 'post',
      data: userQuery
    })
  },

  /**
   *  通过id删除
   * @param id
   * @returns {*}
   */
  deleteUserId(id) {
    return request({
      url: `/user/admin/removeById/${id}`,
      method: 'delete'
    })
  },
  /**
   * 添加用户
   * @param user
   * @returns {*}
   */
  addUser(user) {
    return request({
      url: `/user/admin/addUser`,
      method: 'post',
      data: user   //需要传给数据库的数据
    })
  },

  /**
   * 根据id查询用户
   * @param id
   * @returns {*}
   */
  getUserById(id) {
    return request({
      url: `/user/admin/getUser/${id}`,
      method: 'get'
    })
  },

  /**
   * 更新用户信息
   * @param plane
   * @returns {*}
   */
  updateUserInfo(plane) {
    return request({
      url: `/user/admin/updateUser`,
      method: 'put',
      data: plane  //需要传给数据库的数据
    })
  }

})
